<?php
#
#		 $id: index.php
#		 admin mainfile
require_once("../system/config.php");
require_once("system/local_config.php");
# Let's go work 

//if ($a->checkAuth()) { // Auth

#$server = new HTML_AJAX_Server();
#$server->handleRequest();


switch (@$_GET['page']) {
			 
			 case "scan":
			 include_once("inc/scan.php");
			 break;
			
			 case "news":
			 include_once("inc/news.php");
			 break;

			 case "author":
			 include_once("inc/author.php");
			 break;
			 
			 case "pages":
			 include_once("inc/pages.php");
			 break;
			 
			 case "fotos":
			 include_once("inc/photogal.php");			 
			 break;
			 
			 case "types";
			 include_once("inc/types.php");	
			 break;		
			 
			 case "optimize";
			 include_once("inc/optimize.php");	
			 break;						 
						 
			 case "rebuild";
			 include_once("inc/rebuild.php");	
			 break;						 
						 
			 default:
			 $page_id=1;
			 include_once("inc/news.php");
} // end switch


$pages = display_tree(1);
$smarty->assign("pages", $pages);
$pages_main_menu = $smarty->fetch("col4.tpl");

//$pages_main_menu = display_tree_js(1);

$smarty->assign("pages_main_menu", $pages_main_menu);
$smarty->assign("content", $output);
$smarty->display("page.tpl");
$mdb2->disconnect();

?>